package com.hmall.user.web;

import com.hmall.user.pojo.Address;
import com.hmall.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/address")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 查询地址数据
     * @return
     */
    @GetMapping("/uid")
    public List<Address> UserUid(){
    return userService.userUid();
    }
    /**
     *
     */
    @GetMapping("/{addressId}")
    public Address address(@PathVariable("addressId") Long id){
        return userService.address(id);
    }

}
